
export const SET_BANKCARDLIST = 'SET_BANKCARDLIST' //银行卡列表
export const DELETE_BANKCARD= 'DELETE_BANKCARD' //删除银行卡
export const ADD_BANKCARD= 'ADD_BANKCARD' //添加银行卡

export default{
    state: {
      bankCardList:{},
    },
    mutations: {

        [SET_BANKCARDLIST](state, data) {
            state.bankCardList = data

        },
        [DELETE_BANKCARD](state, id) {
            state.bankCardList.content=  state.bankCardList.content.filter((v)=> v.bankcardId !== id)
        },
        [ADD_BANKCARD](state, data) {
            state.bankCardList.content.push(data);
        }

    },
    actions: {
        [SET_BANKCARDLIST]({commit}, data){
            commit(SET_BANKCARDLIST, data)
        },
        [DELETE_BANKCARD]({commit}, id){
            commit(DELETE_BANKCARD, id)
        },
        [ADD_BANKCARD]({commit}, data){
            commit(ADD_BANKCARD, data)
        }
    }
}